package com.lkbaby.service;

import com.lkbaby.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@Component
/**
 * value: 服务名称
 * fallbackFactry: 服务降级
 */
@FeignClient(value = "SPRINGCLOUD-PROVIDER-DEPT",fallbackFactory = DeptClientServiceFallbackFactory.class)
public interface DeptClientService {

	@PostMapping("/dept/add")	// 生产者提供的接口
	boolean addDept(Dept dept);

	@GetMapping("/dept/get/{id}")
	Dept queryDeptByID(@PathVariable("id") Long id);

	@GetMapping("/dept/list")
	List<Dept> queryAll();

}
